<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <link rel="stylesheet" href="./css/style.css">
  <link rel="stylesheet" href="./css/base.css">
  <link rel="stylesheet" href="./css/normalize.css">
  <link rel="stylesheet" href="./css/swiper-bundle.min.css">

  <script src="./js/jquery-3.6.0.min.js"></script>
  <script src="./js/swiper-bundle.min.js"></script>
</head>
<body>
<!---------------------------------header----------------------->
<iframe src="./header.php" frameborder="0" name="header_iframe" width="100%" scrolling="no"></iframe>
<main>
  <div class="wrapper">
    <form action="./buyProduct.php" method="post">
      <table width="100%">
        <tr>
          <td width="10%">商品编号：</td>
          <td width="35%">商品名称：</td>
          <td width="20%">商品单价：</td>
          <td width="20%">商品数量：</td>
          <td width="15%">商品总价：</td>
        </tr>
        <?php if(is_array($proResult)): foreach($proResult as $pro):?>
        <tr>
          <td width="10%"><input type="text" value="<?=$pro['id']?>" name="pids[]"></td>
          <td width="35%"><?=$pro['name']?></td>
          <td width="20%"><?=$pro['price']?></td>
          <td width="20%"><?=$pro['buynum']?></td>
          <td width="15%"><?=$pro['price']*$pro['buynum']?></td>
        </tr>
        <?php endforeach;endif;?>
        <tr>
          <td colspan="2" >
            <?php if(is_array($nids)): foreach($nids as $nid):?>
            <input type="hidden" name="nids[]" value="<?=$nid?>">
            <?php endforeach;endif;?>
            收货地址：<input type="text" name="receiverAddress" style="border: 1px solid #000;width: 300px;height: 30px;">
          </td>
          <td width="20%">
            收货人：<input type="text" name="receiverName" style="border: 1px solid #000;width: 150px;height: 30px;">
          </td>
          <td width="20%">
            收货电话：<input type="text" name="receiverPhone" style="border: 1px solid #000;width: 150px;height: 30px;">
          </td>
          <td class="ri-but"  width="15%">
            <button type="submit" class="right-but" >立即购买</button>
          </td>
        </tr>
      </table>
    </form>
  </div>
</main>
<iframe src="./footer.php" name="footer_iframe" width="100%" frameborder="0" scrolling="no"></iframe>
</body>
</html>